package com.lobo.blog.mappers;

import com.lobo.blog.entity.Type;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @authoer:MacieSerenity
 * @createDate: 2022/9/29
 * @description:
 */
@Mapper
@Transactional
public interface AdminTypesMapper {

    Type findTypeByName(@Param("typeName") String typeName);

    int addNewType(@Param("type") Type type);

    int updateTypeDeletedStatusToTrue(@Param("type") Type type);

    int updateTypeDeletedStatusToFalse(@Param("type") Type type);

    int updateType(@Param("type") Type type);

    Type getTypeById(@Param("typeId") Integer typeId);

    List<Type> getAllTypeByList();


    int deleteTypeById(@Param("typeId") Integer typeId);
}
